package com.peas.platform.common.core.configuration;

import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.convert.converter.Converter;

@Slf4j
public class ConverterLong implements Converter<String, Long> {

	@Override
	public Long convert(String source) {
		log.debug("ConverterLong, source:" + source);
		if (StrUtil.isBlank(source)) {
			return null;
		}
		if ("null".equalsIgnoreCase(source)) {
			return null;
		}
		return Long.valueOf(source);
	}

}
